<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.9.1"/>
<title>IDA SDK: loader_t Struct Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">IDA SDK
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.9.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="files.html"><span>Header&#160;Files</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-attribs">Public Attributes</a> &#124;
<a href="structloader__t-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">loader_t Struct Reference</div>  </div>
</div><!--header-->
<div class="contents">
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Loader description block - must be exported from the loader module. </p>
</div><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-attribs"></a>
Public Attributes</h2></td></tr>
<tr class="memitem:ae4ae78ca8369c4216b4e3708445f995b"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ae4ae78ca8369c4216b4e3708445f995b"></a>
<a class="el" href="pro_8h.html#a1134b580f8da4de94ca6b1de4d37975e">uint32</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structloader__t.html#ae4ae78ca8369c4216b4e3708445f995b">version</a></td></tr>
<tr class="memdesc:ae4ae78ca8369c4216b4e3708445f995b"><td class="mdescLeft">&#160;</td><td class="mdescRight">api version, should be <a class="el" href="idp_8hpp.html#af4b4e4966302754b758c8cc16f964a15" title="The interface version number. ">IDP_INTERFACE_VERSION</a> <br /></td></tr>
<tr class="separator:ae4ae78ca8369c4216b4e3708445f995b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a049dfabd4bddd202488ce4ff3a263ff0"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a049dfabd4bddd202488ce4ff3a263ff0"></a>
<a class="el" href="pro_8h.html#a1134b580f8da4de94ca6b1de4d37975e">uint32</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structloader__t.html#a049dfabd4bddd202488ce4ff3a263ff0">flags</a></td></tr>
<tr class="memdesc:a049dfabd4bddd202488ce4ff3a263ff0"><td class="mdescLeft">&#160;</td><td class="mdescRight"><a class="el" href="group___l_d_r_f__.html">Loader flags</a> <br /></td></tr>
<tr class="separator:a049dfabd4bddd202488ce4ff3a263ff0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a71ddfdd15d4c7ff137acd776f21ece60"><td class="memItemLeft" align="right" valign="top">int(<a class="el" href="pro_8h.html#a6505e7ff3b129d8b17258304886fd133">idaapi</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structloader__t.html#a71ddfdd15d4c7ff137acd776f21ece60">accept_file</a> )(<a class="el" href="pro_8h.html#a386c10c6aa4340f1d63df85f40454fce">qstring</a> *fileformatname, <a class="el" href="pro_8h.html#a386c10c6aa4340f1d63df85f40454fce">qstring</a> *processor, linput_t *li, const char *filename)</td></tr>
<tr class="memdesc:a71ddfdd15d4c7ff137acd776f21ece60"><td class="mdescLeft">&#160;</td><td class="mdescRight">Check input file format.  <a href="#a71ddfdd15d4c7ff137acd776f21ece60">More...</a><br /></td></tr>
<tr class="separator:a71ddfdd15d4c7ff137acd776f21ece60"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a06ce7bcf929568ec0e8860cebf235f32"><td class="memItemLeft" align="right" valign="top">void(<a class="el" href="pro_8h.html#a6505e7ff3b129d8b17258304886fd133">idaapi</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structloader__t.html#a06ce7bcf929568ec0e8860cebf235f32">load_file</a> )(linput_t *li, <a class="el" href="pro_8h.html#ab95f123a6c9bcfee6a343170ef8c5f69">ushort</a> neflags, const char *fileformatname)</td></tr>
<tr class="memdesc:a06ce7bcf929568ec0e8860cebf235f32"><td class="mdescLeft">&#160;</td><td class="mdescRight">Load file into the database.  <a href="#a06ce7bcf929568ec0e8860cebf235f32">More...</a><br /></td></tr>
<tr class="separator:a06ce7bcf929568ec0e8860cebf235f32"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:afa6dedd156dfe5849199d34b0c89692a"><td class="memItemLeft" align="right" valign="top">int(<a class="el" href="pro_8h.html#a6505e7ff3b129d8b17258304886fd133">idaapi</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structloader__t.html#afa6dedd156dfe5849199d34b0c89692a">save_file</a> )(FILE *fp, const char *fileformatname)</td></tr>
<tr class="memdesc:afa6dedd156dfe5849199d34b0c89692a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Create output file from the database.  <a href="#afa6dedd156dfe5849199d34b0c89692a">More...</a><br /></td></tr>
<tr class="separator:afa6dedd156dfe5849199d34b0c89692a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7a329922101a4e28a2b7018e565a3b5d"><td class="memItemLeft" align="right" valign="top">int(<a class="el" href="pro_8h.html#a6505e7ff3b129d8b17258304886fd133">idaapi</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structloader__t.html#a7a329922101a4e28a2b7018e565a3b5d">move_segm</a> )(<a class="el" href="pro_8h.html#a7b0aeaed04e477c02cf8ea3452002d1a">ea_t</a> from, <a class="el" href="pro_8h.html#a7b0aeaed04e477c02cf8ea3452002d1a">ea_t</a> to, <a class="el" href="pro_8h.html#adbc570541d9f9a0c4489f9f1fe5f5699">asize_t</a> size, const char *fileformatname)</td></tr>
<tr class="memdesc:a7a329922101a4e28a2b7018e565a3b5d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Take care of a moved segment (fix up relocations, for example).  <a href="#a7a329922101a4e28a2b7018e565a3b5d">More...</a><br /></td></tr>
<tr class="separator:a7a329922101a4e28a2b7018e565a3b5d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9f5ef40830d55bde46d1487214ce478a"><td class="memItemLeft" align="right" valign="top">int(<a class="el" href="pro_8h.html#a6505e7ff3b129d8b17258304886fd133">idaapi</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structloader__t.html#a9f5ef40830d55bde46d1487214ce478a">process_archive</a> )(<a class="el" href="pro_8h.html#a386c10c6aa4340f1d63df85f40454fce">qstring</a> *temp_file, linput_t *li, <a class="el" href="pro_8h.html#a386c10c6aa4340f1d63df85f40454fce">qstring</a> *module_name, <a class="el" href="pro_8h.html#ab95f123a6c9bcfee6a343170ef8c5f69">ushort</a> *neflags, const char *fileformatname, const char *defmember, <a class="el" href="pro_8h.html#a386c10c6aa4340f1d63df85f40454fce">qstring</a> *errbuf)</td></tr>
<tr class="memdesc:a9f5ef40830d55bde46d1487214ce478a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Display list of archive members and let the user select one.  <a href="#a9f5ef40830d55bde46d1487214ce478a">More...</a><br /></td></tr>
<tr class="separator:a9f5ef40830d55bde46d1487214ce478a"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Member Data Documentation</h2>
<a class="anchor" id="a71ddfdd15d4c7ff137acd776f21ece60"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int(<a class="el" href="pro_8h.html#a6505e7ff3b129d8b17258304886fd133">idaapi</a> * loader_t::accept_file) (<a class="el" href="pro_8h.html#a386c10c6aa4340f1d63df85f40454fce">qstring</a> *fileformatname, <a class="el" href="pro_8h.html#a386c10c6aa4340f1d63df85f40454fce">qstring</a> *processor, linput_t *li, const char *filename)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Check input file format. </p>
<p>This function will be called one or more times depending on the result value. </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[out]</td><td class="paramname">fileformat</td><td>name of file format </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">processor</td><td>desired processor (optional) </td></tr>
    <tr><td class="paramdir"></td><td class="paramname">li</td><td>input file </td></tr>
    <tr><td class="paramdir"></td><td class="paramname">filename</td><td>name of the input file, if it is an archive member name then the actual file doesn't exist </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>1 if file format is recognized, and fills 'fileformatname', otherwise returns 0. This function may return a unique file format number instead of 1. To get this unique number, please contact the author. If the return value is ORed with <a class="el" href="loader_8hpp.html#a95d411e4e7c809664e1ba33c61b0bffa" title="Specify that a file format is served by archive loader See loader_t::accept_file. ...">ACCEPT_ARCHIVE</a>, then it is an archive loader. Its <a class="el" href="structloader__t.html#a9f5ef40830d55bde46d1487214ce478a" title="Display list of archive members and let the user select one. ">process_archive()</a> will be called instead of <a class="el" href="structloader__t.html#a06ce7bcf929568ec0e8860cebf235f32" title="Load file into the database. ">load_file()</a>. If the return value is ORed with <a class="el" href="loader_8hpp.html#a60fb3c4f4605753d48e4c437f924e7be" title="Specify that the function must be called another time See loader_t::accept_file. ">ACCEPT_CONTINUE</a>, then this function will be called another time. If the return value is ORed with <a class="el" href="loader_8hpp.html#ac4a513b8be5b7a4aa5984ea4f43eacd1" title="Specify that a file format should be place first in &quot;load file&quot; dialog box. ">ACCEPT_FIRST</a>, then this format should be placed first in the "load file" dialog box. In the sorting order of file formats the archive formats have priority. </dd></dl>

</div>
</div>
<a class="anchor" id="a06ce7bcf929568ec0e8860cebf235f32"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void(<a class="el" href="pro_8h.html#a6505e7ff3b129d8b17258304886fd133">idaapi</a> * loader_t::load_file) (linput_t *li, <a class="el" href="pro_8h.html#ab95f123a6c9bcfee6a343170ef8c5f69">ushort</a> neflags, const char *fileformatname)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Load file into the database. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">li</td><td>input file </td></tr>
    <tr><td class="paramname">neflags</td><td><a class="el" href="group___n_e_f__.html">Load file flags</a> </td></tr>
    <tr><td class="paramname">fileformatname</td><td>name of type of the file (it was returned by <a class="el" href="structloader__t.html#a71ddfdd15d4c7ff137acd776f21ece60" title="Check input file format. ">accept_file</a>)</td></tr>
  </table>
  </dd>
</dl>
<p>If this function fails, <a class="el" href="loader_8hpp.html#ac5e3189d54cc0c34924fb28ebacbbbc3" title="Display a message about a loader failure and stop the loading process. ">loader_failure()</a> should be called </p>

</div>
</div>
<a class="anchor" id="afa6dedd156dfe5849199d34b0c89692a"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int(<a class="el" href="pro_8h.html#a6505e7ff3b129d8b17258304886fd133">idaapi</a> * loader_t::save_file) (FILE *fp, const char *fileformatname)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Create output file from the database. </p>
<p>This function may be absent. If fp == NULL, then this function returns:</p><ul>
<li>0: can't create file of this type</li>
<li>1: ok, can create file of this type</li>
</ul>
<p>If fp != NULL, then this function should create the output file </p>

</div>
</div>
<a class="anchor" id="a7a329922101a4e28a2b7018e565a3b5d"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int(<a class="el" href="pro_8h.html#a6505e7ff3b129d8b17258304886fd133">idaapi</a> * loader_t::move_segm) (<a class="el" href="pro_8h.html#a7b0aeaed04e477c02cf8ea3452002d1a">ea_t</a> from, <a class="el" href="pro_8h.html#a7b0aeaed04e477c02cf8ea3452002d1a">ea_t</a> to, <a class="el" href="pro_8h.html#adbc570541d9f9a0c4489f9f1fe5f5699">asize_t</a> size, const char *fileformatname)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Take care of a moved segment (fix up relocations, for example). </p>
<p>This function may be absent. A special calling method</p><div class="fragment"><div class="line"><a class="code" href="structloader__t.html#a7a329922101a4e28a2b7018e565a3b5d">move_segm</a>(<a class="code" href="pro_8h.html#a63a7c1cde5fb0cf0d0023d55c742dd4f">BADADDR</a>, delta, 0, formatname); </div>
</div><!-- fragment --><p> means that the whole program has been moved in the memory (rebased) by delta bytes </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">from</td><td>previous linear address of the segment </td></tr>
    <tr><td class="paramname">to</td><td>current linear address of the segment </td></tr>
    <tr><td class="paramname">size</td><td>size of the moved segment </td></tr>
    <tr><td class="paramname">fileformatname</td><td>the file format </td></tr>
  </table>
  </dd>
</dl>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">1</td><td>ok </td></tr>
    <tr><td class="paramname">0</td><td>failure </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a9f5ef40830d55bde46d1487214ce478a"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int(<a class="el" href="pro_8h.html#a6505e7ff3b129d8b17258304886fd133">idaapi</a> * loader_t::process_archive) (<a class="el" href="pro_8h.html#a386c10c6aa4340f1d63df85f40454fce">qstring</a> *temp_file, linput_t *li, <a class="el" href="pro_8h.html#a386c10c6aa4340f1d63df85f40454fce">qstring</a> *module_name, <a class="el" href="pro_8h.html#ab95f123a6c9bcfee6a343170ef8c5f69">ushort</a> *neflags, const char *fileformatname, const char *defmember, <a class="el" href="pro_8h.html#a386c10c6aa4340f1d63df85f40454fce">qstring</a> *errbuf)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Display list of archive members and let the user select one. </p>
<p>Extract the selected archive member into a temporary file. </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[out]</td><td class="paramname">temp_file</td><td>name of the file with the extracted archive member. </td></tr>
    <tr><td class="paramdir"></td><td class="paramname">li</td><td>input file </td></tr>
    <tr><td class="paramdir">[in,out]</td><td class="paramname">module_name</td><td>in: name of archive out: name of the extracted archive member </td></tr>
    <tr><td class="paramdir">[in,out]</td><td class="paramname">neflags</td><td><a class="el" href="group___n_e_f__.html">Load file flags</a> </td></tr>
    <tr><td class="paramdir"></td><td class="paramname">fileformatname</td><td>name of type of the file (it was returned by <a class="el" href="structloader__t.html#a71ddfdd15d4c7ff137acd776f21ece60" title="Check input file format. ">accept_file</a>) </td></tr>
    <tr><td class="paramdir"></td><td class="paramname">defmember</td><td>extract the specified member, for example "subdir/member.exe", may be NULL </td></tr>
    <tr><td class="paramdir"></td><td class="paramname">errbuf</td><td>error message if 0 is returned, may be NULL </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>-1-cancelled by the user, 1-ok, 0-error, see errbuf for details </dd></dl>

</div>
</div>
<hr/>The documentation for this struct was generated from the following file:<ul>
<li><a class="el" href="loader_8hpp.html">loader.hpp</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.9.1
</small></address>
</body>
</html>
